<template>
	<view class="box bg_fff">
		<view class="top_img_wrapper">
			<image src="../../static/image/user/i@2x.png" class="top_img"></image>
			<view class="color_fff top_img_content text_bold hidden">
				<view>免费入驻无包游</view>
				<view class="font_54">额外收益赚不停</view>
			</view>
		</view>
		<view class="content">
			<view class="font_27 color_ff0008 cooperat_p1">*请正确填写一下内容，以便及时与您联系</view>
			<view class="list flex3 van-hairline--bottom">
				<view class="label font_33">姓<text style="color: #fff;">空</text>名：</view>
				<view class="w_flex1">
					<input class="font_33" placeholder="请输入您的姓名" placeholder-style="color: #acacac"
						v-model="submit_info.username" />
				</view>
			</view>
			<view class="list flex3 van-hairline--bottom">
				<view class="label font_33">手机号：</view>
				<view class="w_flex1">
					<input class="font_33" type="number" maxlength="11" placeholder="请输入您的手机号码"
						placeholder-style="color: #acacac" v-model="submit_info.mobile" />
				</view>
			</view>
			<view class="list flex3 van-hairline--bottom">
				<view class="label font_33">地<text style="color: #fff;">空</text>址：</view>
				<view class="w_flex1">
					<input class="font_33" placeholder="请输入店铺的详细地址" placeholder-style="color: #acacac"
						v-model="submit_info.address" />
				</view>
			</view>
		</view>
		<view class="btn2" @click="get_sure">确认</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				submit_info: {
					username: '', // 姓名
					mobile: '', // 手机号
					address: '', // 地址
				}
			}
		},
		onShow() {
			if (!uni.getStorageSync('token')) {
				getApp().get_navigate_url('/pages/index/login');
				return;
			}
		},
		methods: {
			get_sure() {
				if (!this.submit_info.username) return getApp().get_msg('请输入您的姓名');
				if (this.submit_info.mobile.length !== 11) return getApp().get_msg('请输入正确的手机号');
				if (!this.submit_info.address) return getApp().get_msg('请输入店铺的详细地址');

				this.$http.post(this.$api.business, this.submit_info).then(res => {
					getApp().get_msg('提交成功');
					getApp().get_back();
				})
			}
		}
	}
</script>

<style lang="less">
	.cooperat_p1 {
		padding: 27rpx 0 12rpx;
	}

	.top_img_wrapper {
		position: relative;

		.top_img_content {
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			text-align: center;
			position: absolute;

			view {
				&:first-child {
					font-size: 79rpx;
					line-height: 101rpx;
					margin: 62rpx 0 0;
				}
			}
		}
	}

	.top_img {
		width: 100%;
		height: 754rpx;
	}

	.content {
		padding: 0 46rpx;
	}

	.list {
		height: 115rpx;
	}

	.label {
		margin-right: 23rpx;
	}

	.van-hairline--bottom::after {
		border-color: #D2D2D2;
	}

	.btn2 {
		margin: 44rpx auto 50rpx;
	}
</style>
